/*
 * Copyright (C) 2023 Coder.AN
 * Email: an.hongjun@foxmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
#ifndef __REALSENSE_CAMERA_H__
#define __REALSENSE_CAMERA_H__


#define REALSENSE_WIDTH     1280
#define REALSENSE_HEIGHT    720
#define REALSENSE_FPS       30
#define REALSENSE_QUE_SIZE  5

#include "opencv.h"
#include <thread>
#include <librealsense2/rs.hpp>


class RealsenseCam
{
private:
    uint32_t width;
    uint32_t height;

    rs2::colorizer  color_map;      // 彩色图
    rs2::pipeline   pipe;           // realsense管道
    rs2::config     pipe_config;    // 数据流配置信息
    rs2::pipeline_profile profile;

    cv::Mat color_image, depth_image;

public:
    RealsenseCam(uint32_t width=REALSENSE_WIDTH, uint32_t height=REALSENSE_HEIGHT,
    uint16_t fps=REALSENSE_FPS);
    void get_all(cv::Mat &color_image, cv::Mat &depth_image);
};

#endif // __REALSENSE_CAMERA_H__
